
import classNames from 'classnames'
import { ReactNode } from 'react';
import styles from './index.module.scss'

interface prpos extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
  [x: string]: any;
  className?: string;
  extra?: ReactNode;
  errMsg?: string;
}
export default function index({ className, extra, errMsg, ...rest }: prpos) {
  return (
    <div className={styles.root}>
      <div className='input-box'>
        <input
          className={classNames('input', className)}
          {...rest}
        />
        {errMsg ? <div className='validate'>{errMsg}</div> : null}

        {extra ? <div className='extra'>{extra}</div> : null}

      </div>
    </div>
  )
}
